home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / pure_src / lib2.src < prev    next >
Encoding:
Text File  |  1993-03-03  |  47.8 KB  |  1,460 lines

  1. screen( capsensitive("access"))
  2. NAME
  3.     access - determine accessibility of a file
  4.  
  5. SYNOPSIS
  6.     #include <unistd.h>
  7.  
  8.     int access(const char *path, int amode);
  9.  
  10. DESCRIPTION
  11.     path points to a path naming a file. access checks the named
  12.     file for accessibility, using the real user ID and real group
  13.     ID of the process. The bit pattern contained in amode is
  14.     constructed as follows:
  15.       04: read
  16.       02: write
  17.       01: execute (search for directories)
  18.       00: check existence of file
  19.  
  20.     The owner of a file has permission checked with respect to
  21.     the "owner" read, write and execute mode bits. Members of
  22.     the file's group other than the owner have permissions checked
  23.     with respect to the "group" mode bits, and all others have
  24.     permissions checked with respect to the "other" mode bits.
  25.     If the real user ID is 0 (super-user), success is always
  26.     returned for any existing file.
  27.  
  28. SEE ALSO
  29.     \#chmod\#, \#stat\#
  30.  
  31. RETURN VALUES
  32.      0 if access is permitted.
  33.     -1 if access is not permitted or if the file does not exist;
  34.        errno is set to indicate the error.
  35.  
  36. NOTE
  37.     Under TOS or on a MS-DOS (TOS) file-system, this call is pretty
  38.     bogus and can best be used to check for existence of the file.\end
  39.  
  40. screen( capsensitive("alarm"))
  41. NAME
  42.     alarm - set a process alarm clock
  43.  
  44. SYNOPSIS
  45.     #include <unistd.h>
  46.  
  47.     unsigned alarm(unsigned sec);
  48.  
  49. DESCRIPTION
  50.     alarm instructs the alarm clock of the calling process to send
  51.     the signal SIGALRM to the calling process after the number of
  52.     real time seconds specified by sec have elapsed. When 32-bit
  53.     integers are used, the largest value that is allowed for sec
  54.     is (2^31 - 1) / 1000; larger values are silently rounded down.
  55.     Thus, the longest alarm takes about 3 weeks to deliver. 
  56.  
  57.     Alarm requests are not stacked; successive calls reset the
  58.     alarm clock of the calling process.
  59.  
  60.     If sec is 0, any previously made alarm request is cancelled.
  61.  
  62. SEE ALSO
  63.     \#pause\#, \#signal\#, \#sigpause\#, \#sigset\#
  64.     \#Talarm\#; this system call is used in the implementation
  65.     of this routine.
  66.  
  67. RETURN VALUES
  68.     alarm returns the amount of time previously remaining in the
  69.     alarm clock of the calling process, or 0 if no alarm was
  70.     scheduled.
  71.  
  72. NOTE
  73.     This call only works when MiNT is active; under TOS, zero
  74.     is always returned.\end
  75.  
  76. screen( capsensitive("atexit"))
  77. NAME
  78.     atexit - register exit cleanup function
  79.  
  80. SYNOPSIS
  81.     #include <stdlib.h>
  82.  
  83.     int atexit(void (*)(void));
  84.  
  85. DESCRIPTION
  86.     atexit registers exit cleanup functions to be called
  87.     when the process is terminated using \#exit\#. The
  88.     functions supplied should not need any parameters and
  89.     should not return any values.
  90.  
  91.     Processes terminated by calling _exit will circumvent
  92.     any registered cleanup functions.
  93.  
  94. RETURN VALUES
  95.      0 on success.
  96.     -1 on failure; errno is set to indicate the error.
  97.  
  98. SEE ALSO
  99.     \#exit\#, \#_exit\#
  100.  
  101. NOTE
  102.     ANSI requires atexit to be able to register at least 32
  103.     functions. The mintlibs allocate memory dynamically
  104.     through using \#malloc\#; it is hoped this is okay.\end
  105.     
  106. screen( capsensitive("chdir"))
  107. NAME
  108.     chdir - change working directory
  109.  
  110. SYNOPSIS
  111.     #include <unistd.h>
  112.  
  113.     int chdir(const char *path);
  114.  
  115. DESCRIPTION
  116.     Path points to the path name of a directory. chdir causes the
  117.     named directory to become the current working directory, the
  118.     starting path for path searches for path names not beginning
  119.     with /.
  120.  
  121. SEE ALSO
  122.     \#getcwd\#
  123.     \#Dsetdrv\#, \#Dsetpath\# - these GEMDOS functions are used to
  124.                         implement this library function.
  125.  
  126. RETURN VALUES
  127.      0 upon successfull completion.
  128.     -1 when an error occurs; errno is set to indicate the error.\end
  129.  
  130. screen( capsensitive("chmod"))
  131. NAME
  132.     chmod - change mode of file
  133.  
  134. SYNOPSIS
  135.     #include <unistd.h>
  136.  
  137.     int chmod(const char *path, int mode);
  138.  
  139. DESCRIPTION
  140.     path points to a path name naming a file. chmod sets the access
  141.     permission portion of the named file's mode according to the
  142.     bit pattern contained in the mode parameter.
  143.  
  144.     The possible access permission bits are defined in the include
  145.     file <sys/stat.h>, see the \#stat\# call.
  146.  
  147.     The effective user ID of the process must match the owner of the
  148.     file or be super-user to change the mode of a file.
  149.  
  150. RETURN VALUES
  151.      0 on success
  152.     -1 on failure; errno is set to indicate the error.
  153.  
  154. SEE ALSO
  155.     \#chown\#, \#creat\#, \#fcntl\#, \#open\#, \#stat\#, \#umask\#
  156.     \#Fchmod\#, \#Fattrib\#; these system calls are used in the
  157.     implementation of this routine.\end
  158.  
  159. screen( capsensitive("chown"))
  160. NAME
  161.     chown - change owner and group of a file
  162.  
  163. SYNOPSIS
  164.     #include <unistd.h>
  165.  
  166.     int chown(const char *path, int uid, int gid);
  167.  
  168. DESCRIPTION
  169.     path points to a path naming a file. The owner ID and group ID
  170.     of the file are set to the numeric values contained in uid and
  171.     gid respectively.
  172.  
  173.     Only a process with effective uid 0 or whose effective uid
  174.     matches the user ownership of the file may make this call.
  175.     In the latter case, the new uid must match the old one, and
  176.     the calling process must also be a member of the group
  177.     specified by gid.
  178.  
  179. RETURN VALUES
  180.      0 on success
  181.     -1 on failure; errno is set to indicate the error
  182.  
  183. SEE ALSO
  184.     \#chmod\#
  185.     \#Fchown\#; this system call is used in the implementation
  186.     of this routine.
  187.  
  188. NOTES
  189.     When MiNT is not active, this routine is bogus.
  190.  
  191.     MS-DOS (TOS) file systems do not understand file ownership.\end
  192.  
  193. screen( capsensitive("close"))
  194. NAME
  195.     close - close a file descriptor
  196.  
  197. SYNOPSIS
  198.     #include <unistd.h>
  199.  
  200.     int close(int fildes);
  201.  
  202. DESCRIPTION
  203.     fildes is a file descriptor obtained from a \#creat\#, \#open\#, \#dup\#,
  204.     \#fcntl\# or \#pipe\# system call. close closes the file descriptor
  205.     indicated by fildes. All outstanding record locks owned by the
  206.     process on the file indicated by fildes are closed.
  207.  
  208. RETURN VALUES
  209.      0 on success
  210.     -1 on failure; errno is set to indicate the error.
  211.  
  212. SEE ALSO
  213.     \#creat\#, \#dup\#, \#fcntl\#, \#open\#, \#pipe\#
  214.     \#Fclose\#; this system call is used in the implementation of
  215.     this routine.\end
  216.  
  217. screen( capsensitive("creat"))
  218. NAME
  219.     creat - create a new file
  220.  
  221. SYNOPSIS
  222.     #include <unistd.h>
  223.  
  224.     int creat(const char *path, unsigned int mode);
  225.  
  226. DESCRIPTION
  227.     This interface is made obsolete by \#open\#, since,
  228.  
  229.       creat(path, mode);
  230.  
  231.     is equivalent to
  232.  
  233.       open(path, O_WRONLY | O_CREAT | O_TRUNC, mode);
  234.  
  235.     which actually is the way creat is implemented.
  236.  
  237.     creat creates a new ordinary file or prepares to rewrite
  238.     an existing file named by the pathname pointed to by path.
  239.     If the file did not exist, it is given the mode 'mode', as
  240.     modified by the process's mode mask (see \#umask\#). See
  241.     \#stat\# for the construction of mode.
  242.  
  243.     If the file exists, its mode and owner remain unchanged, but
  244.     it is truncated to 0 length. Otherwise, the file's owner ID
  245.     is set to the effective user ID of the process, and upon
  246.     successful completion, creat marks for update the
  247.     st_atime, st_ctime, and st_mtime fields of the file (see
  248.     \#stat\#) and the st_ctime and st_mtime fields of the parent
  249.     directory.
  250.  
  251.     Upon successful completion, the file descriptor is returned
  252.     and the file is open for writing, even if the access permis-
  253.     sions of the file mode do not permit writing. The file
  254.     pointer is set to the beginning of the file. The file
  255.     descriptor is set to remain open across \#execve\# system
  256.     calls. See \#fcntl\#.
  257.  
  258. RETURN VALUES
  259.     creat returns a non-negative descriptor that only permits
  260.     writing on success. On failure, it returns -1 and sets
  261.     errno to indicate the error.
  262.  
  263. SEE ALSO
  264.     \#close\#, \#chmod\#, \#execve\#, \#fcntl\#, \#flock\#, \#open\#, \#write\#, \#umask\#\end
  265.  
  266. screen( capsensitive("dup"),
  267.         capsensitive("dup2"))
  268. NAME
  269.     dup, dup2 - duplicate a file descriptor
  270.  
  271. SYNOPSIS
  272.     #include <unistd.h>
  273.  
  274.     int dup(int fd);
  275.  
  276.     int dup2(int fd1, int fd2);
  277.  
  278. DESCRIPTION
  279.     dup duplicates an existing file descriptor. The argument fd is a
  280.     small non-negative integer index in the per-process descriptor
  281.     table. The new descriptor returned by the call is the lowest
  282.     numbered descriptor that is not currently in use by the process.
  283.  
  284.     With dup2, fd2 specifies the desired value of the new descriptor.
  285.     If descriptor fd2 is already in use, it is first deallocted as
  286.     if it were closed by \#close\#.
  287.  
  288.     The new descriptor has the following in common with the original:
  289.  
  290.     - It refers to the same object that the old
  291.       descriptor referred to.
  292.  
  293.     - It uses the same seek pointer as the old descriptor
  294.       (that is, both file descriptors share one seek pointer).
  295.  
  296.     - It has the same access mode (read, write or read/write)
  297.       as the old descriptor.
  298.  
  299.     Thus if fd2 and fd1 are duplicate references to an open file,
  300.     \#read\#, \#write\#, and \#lseek\# calls all move a single seek
  301.     pointer into the file, and append mode is shared between the
  302.     references. If a separate seek pointer into the file is
  303.     desired, a different object reference to the file must be
  304.     obtained by issuing an additional \#open\# call.
  305.  
  306. RETURN VALUES
  307.     dup and dup2 return a new descriptor on success.
  308.     On failure, they return -1 and set errno to indicate the error.
  309.  
  310. SEE ALSO
  311.     \#close\#, \#fcntl\#, \#lseek\#, \#open\#, \#pipe\#, \#read\#, \#write\#
  312.     \#Fdup\#, \#Fforce\#, \#Fcntl\# - these system calls are used in
  313.     the implementation of these routines.\end
  314.  
  315. screen( capsensitive("exit"),
  316.         capsensitive("_exit"))
  317. NAME
  318.     exit, _exit - terminate process
  319.  
  320. SYNOPSIS
  321.     #include <stdlib.h>
  322.  
  323.     void exit(int status);
  324.  
  325.     #include <unistd.h>
  326.  
  327.     void _exit(int status);
  328.  
  329. DESCRIPTION
  330.     exit terminates the calling process in the following way:
  331.       - All registered exit handlers are called (see \#atexit\#).
  332.       - Standard input, standard output, and standard error
  333.         output are flushed.
  334.       - All other open file descriptors are closed
  335.       - \#_exit\# is called with the argument passed to exit.
  336.  
  337.     Returning from main() with a value is identical to calling
  338.     exit with the same value.
  339.  
  340.     _exit terminates the calling process without cleanup action:
  341.       - If profiling is active, profiling will be ended
  342.         and the results will be written out to file. 
  343.       - \#Pterm\# is called with the argument passed to _exit.
  344.  
  345. SEE ALSO
  346.     \#atexit\#, \#Pterm\#, \#wait\#
  347.  
  348. NOTES
  349.     The argument to exit is returned as the return code to the
  350.     calling program. Zero should be returned on success, non-
  351.     zero should be returned on failure or abnormal termination.
  352.  
  353.     The Operating System does many things on process termination
  354.     not mentioned above. For instance, memory is freed, the parent
  355.     process is signalled, file locks are released and so on.\end
  356.  
  357. screen( capsensitive("fcntl"))
  358. NAME
  359.     fcntl - file control
  360.  
  361. SYNOPSIS
  362.     #include <fcntl.h>
  363.  
  364.     int fcntl(int fildes, int cmd, ...);
  365.  
  366. DESCRIPTION
  367.     fcntl provides for control over open files. fildes is a file
  368.     descriptor obtained from a \#creat\#, \#dup\#, \#fcntl\#, \#open\# or \#pipe\#
  369.     call.
  370.  
  371.     Since the fcntl call is nothing but an interface to the \#Fcntl\#
  372.     system call, the user is referred to the \#Fcntl\# page for an
  373.     overview of available commands.
  374.  
  375. SEE ALSO
  376.     \#creat\#, \#dup\#, \#fcntl\#, \#open\#, \#pipe\#
  377.  
  378. RETURN VALUES
  379.     See \#Fcntl\# for a detailed description of return codes.
  380.     In general, -1 is returned on failure; any other value
  381.     indicates success; the meaning is dependent on the command
  382.     executed.
  383.  
  384. NOTES
  385.     Under TOS, fcntl always returns -1.
  386.  
  387.     The available commands for \#Fcntl\# tend to increase all the
  388.     time; the current list is likely to be out of date.\end
  389.     
  390. screen( capsensitive("fork"))
  391. NAME
  392.     fork - create a new process
  393.  
  394. SYNOPSIS
  395.     #include <unistd.h>
  396.  
  397.     int fork(void);
  398.  
  399. DESCRIPTION
  400.     fork creates a copy of the current process using \#Pfork\#.
  401.     This call splits the program into two copies, both of
  402.     which continue to run. The only difference between the
  403.     two is the returned value. In one of these processes,
  404.     the child, this is zero. In the other, the parent, it is 
  405.     non-zero; it is the process ID of the child (a positive
  406.     number), or a negative error code if the call failed.
  407.  
  408. SEE ALSO
  409.     \link("exec")exec..\#, \#tfork\#, \#vfork\#, \#wait\#
  410.  
  411. NOTES
  412.     At the moment (MiNT 0.99 and earlier), \#Pfork\#, and
  413.     consequently also fork, suspends the parent until the
  414.     child has terminated or overlays itself. This has yet
  415.     to be fixed, and may cause problems when porting UN*X
  416.     programs.
  417.  
  418.     There are various intricate differences between the
  419.     parent and the child process, like the effects of
  420.     closing a file on which a lock has been obtained
  421.     (the parent owns the locks). You are advised to check
  422.     the man pages for \#Pfork\# and \#Pvfork\#, in addition
  423.     to the kernel sources, if you really want to know.\end
  424.  
  425. screen( capsensitive("getpagesize"))
  426. NAME
  427.     getpagesize - get system default page size
  428.  
  429. SYNOPSIS
  430.     #include <unistd.h>
  431.  
  432.     int getpagesize(void);
  433.  
  434. DESCRIPTION
  435.     This function returns the default page size as used by the
  436.     system. This may be of interest to programs that (partly) want
  437.     to manage their memory allocation/deallocation.
  438.  
  439. RETURN VALUES
  440.     Under TOS or MiNT earlier than 0.9, 1024 is always returned.
  441.     Using MiNT 0.9 or later, the default page size is returned.
  442.     Currenly, pagesize is 8192 (the largest page size allowed
  443.     by the MC68040 processor).\end
  444.  
  445. screen( capsensitive("getpid"),
  446.         capsensitive("getpgrp"),
  447.         capsensitive("getppid"))
  448. NAME
  449.     getpid, getprgp, getppid - get process, process group,
  450.                                and parent process IDs
  451.  
  452. SYNOPSIS
  453.     #include <unistd.h>
  454.  
  455.     int getpid(void);
  456.  
  457.     int getprgp(void);
  458.  
  459.     int getppid(void);
  460.  
  461. DESCRIPTION
  462.     getpid returns the process ID of the calling process.
  463.  
  464.     getpgrp returns the process group ID of the calling process.
  465.  
  466.     getppid returns the parent process ID of the calling process.
  467.  
  468. SEE ALSO
  469.     \#setpgrp\#
  470.     \#Pgetpid\#, \#Pgetpgrp\#, \#Pgetppid\#; these system calls are used in
  471.     the implementation of these routines.
  472.  
  473. NOTES
  474.     When MiNT is not active, the 16 most significant bits of the
  475.     basepage of the process are returned for getpid; 0 is returned
  476.     for getpgrp; the 16 most significant bits of the parents process'
  477.     basepage are returned for getppid.
  478.  
  479.     It seems that the BSD UN*X version of getpgrp takes an argument.\end
  480.  
  481. screen( capsensitive("getuid"),
  482.         capsensitive("geteuid"),
  483.         capsensitive("getgid"),
  484.         capsensitive("getegid"))
  485. NAME
  486.     getuid, geteuid, getgid, getegid - get real user, effective user,
  487.                                        real group and effective group IDs
  488.  
  489. SYNOPSIS
  490.     #include <sys/types.h>
  491.     #include <unistd.h>
  492.  
  493.     uid_t getuid(void);
  494.  
  495.     uit_t geteuid(void);
  496.  
  497.     gid_t getgid(void);
  498.  
  499.     gid_t getegid(void);
  500.  
  501. DESCRIPTION
  502.     getuid returns the real user ID of the calling process.
  503.     geteuid returns the effective user ID of the calling process.
  504.     getgid returns the real group ID of the calling process.
  505.     getegid returns the effective group ID of the calling process.
  506.  
  507. SEE ALSO
  508.     \#setuid\#, \#setgid\#
  509.     \#Pgetuid\#, \#Pgeteuid\#, \#Pgetgid\#, \#Pgetegid\#; these system
  510.     calls are used in the implementation of these routines.
  511.  
  512. NOTES
  513.     On UN*X systems, these calls have the type unsigned short, which is
  514.     equal to uid_t and gid_t.
  515.  
  516.     When MiNT is not active, these calls are pretty bogus.
  517.  
  518.     Pgeteuid and Pgetegid have only been available since MiNT 0.95\end
  519.  
  520. screen( capsensitive("kill"))
  521. NAME
  522.     kill - send a signal to a process or a group of processes
  523.  
  524. SYNOPSIS
  525.     #include <unistd.h>
  526.  
  527.     int kill(int pid, int sig);
  528.  
  529. DESCRIPTION
  530.     kill sends a signal to a process or a group of processes.
  531.     The process of group of processes to which the signal is to
  532.     be sent is specified by pid. The signal that is to be sent
  533.     is specified by sig and is either on from the list given in
  534.     \#signal\#, or 0. If sig is 0 (the null signal), error checking
  535.     is performed but no signal is actually sent. This can be used
  536.     to check the validity of pid.
  537.  
  538.     The real user ID of the sending process must match the real
  539.     user ID of the receiving process, unless the effective user
  540.     ID of the sending process is super-user.
  541.  
  542.     If pid is greater than zero, sig will be sent to the process
  543.     whose process ID is equal to pid.
  544.  
  545.     If pid is 0, sig will be sent to all processes whose process
  546.     group ID is equal to the process group ID of the sender.
  547.  
  548.     If pid is negative, sig will be sent to all processes whose
  549.     process group ID is equal to the absolute value of pid.
  550.  
  551. RETURN VALUES
  552.      0 on success
  553.     -1 on failure; errno is set to indicate the error
  554.  
  555. SEE ALSO
  556.     \#getpid\#, \#getpgrp\#, \#setprgp\#, \#signal\#
  557.     \#Pkill\#; this system call is used in the implementation of
  558.     this routine.
  559.  
  560. NOTES
  561.     Under UN*X, the real or effective user ID of the sending
  562.     process must match the real or effective user ID of the
  563.     receiving process, or the effective user ID of the sending
  564.     process must be super-user.
  565.  
  566.     Under UN*X, the processes with a process ID of 0 and a
  567.     process ID of 1 are treated specially.\end
  568.  
  569. screen( capsensitive("link"))
  570. NAME
  571.     link - link to a file
  572.  
  573. SYNOPSIS
  574.     #include <support.h>
  575.  
  576.     int link(const char *old, const char *new);
  577.  
  578. DESCRIPTION
  579.     old points to a path name naming an existing file. new points to
  580.     a path name naming the new directory entry to be created. link
  581.     creates a new hardlink (directory entry) for the existing file.
  582.  
  583. RETURN VALUES
  584.      0 on success
  585.     -1 on failure; errno is set to indicate the error.
  586.  
  587. SEE ALSO
  588.     \#readlink\#, \#symlink\#, \#unlink\#
  589.     \#Flink\#; this system call is used in the implementation
  590.     of this routine.
  591.  
  592. NOTE
  593.     link will only fuction properly if MiNT 0.9 or later is active
  594.     and the file system supports hardlinks. MS-DOS (TOS) file
  595.     systems do not support hardlinks.\end
  596.  
  597. screen( capsensitive("lseek"),
  598.         capsensitive("tell"))
  599. NAME
  600.     lseek, tell - move read/write file pointer
  601.  
  602. SYNOPSIS
  603.     #include <unistd.h>
  604.  
  605.     long lseek(int fildes, long offset, int mode);
  606.  
  607.     long tell(int fd);
  608.  
  609. DESCRIPTION
  610.     fildes is a file descriptor returned from a \#creat\#, \#open\#, \#dup\#,
  611.     or \#fcntl\# system call. lseek sets the file pointer associated with
  612.     fildes as follows, according to value of the mode paramater:
  613.     - SEEK_SET (0): the pointer is set to offset bytes
  614.     - SEEK_CUR (1): the pointer is set to its current
  615.                     location plus offset
  616.     - SEEK_END (2): the pointer is set to the size of
  617.                     the file plus offset
  618.  
  619.     If the seek would set the pointer beyond the end of the file,
  620.     and the file is then written to, the file is extended with zeros.
  621.     If the filesystem supports sparse files, this may not take much
  622.     space on disc.
  623.  
  624.     The obsolete function tell(fd) is equivalent to:
  625.       lseek(fd, 0L, SEEK_CUR).
  626.  
  627. RETURN VALUES
  628.     On success, the new position of the file pointer is returned.
  629.     On failure, a negative number is returned, and errno is set.
  630.  
  631. SEE ALSO
  632.     \#creat\#, \#dup\#, \#fcntl\#, \#fseek\#, \#open\#
  633.     \#Fseek\# - this system call is used in the implementation of
  634.     this routine.\end
  635.  
  636. screen( capsensitive("mkdir"))
  637. NAME
  638.     mkdir - make a directory
  639.  
  640. SYNOPSIS
  641.     #include <unistd.h>
  642.  
  643.     int mkdir(const char *path, unsigned int mode);
  644.  
  645. DESCRIPTION
  646.     The routine mkdir creates a new directory with the name path.
  647.     The mode of the new directory is initialized from the mode.
  648.     The protection part of the mode argument is modified by the
  649.     process's mode mask (see \#umask\#).
  650.  
  651.     The directory's owner ID is set to the process's effective user ID.
  652.     The directory's group ID is set to the process's effective group ID.
  653.     The newly created directory is empty except for the entries '.' and
  654.     '..'.
  655.  
  656. RETURN VALUES
  657.      0 upon successfull completion.
  658.     -1 on error; errno is set to indicate the error.
  659.  
  660. SEE ALSO
  661.     \#rmdir\#
  662.     \#Dcreate\#; this system call is used in the implementation of this
  663.     routine.\end
  664.  
  665. screen( capsensitive("mknod"))
  666. NAME
  667.     mknod - make a directory, or a special or ordinary file
  668.  
  669. SYNOPSIS
  670.     int mknod(const char *path, int mode, int dev);
  671.  
  672. DESCRIPTION
  673.     In the current version of MiNT and the mintlibs, mknod is bogus.
  674.     It will always return -1, with errno set to EINVAL.
  675.  
  676. SEE ALSO
  677.     \#chmod\#, \#chown\#, \#creat\#, \#mkdir\#, \#umask\#\end
  678.  
  679. screen( capsensitive("open"))
  680. NAME
  681.     open - open or create a file for reading or writing
  682.  
  683. SYNOPSIS
  684.     #include <unistd.h>
  685.     #include <fcntl.h>
  686.  
  687.     int open(const char *filename, int flags, ...);
  688.  
  689. DESCRIPTION
  690.     filename points to the pathname of a file. open opens the
  691.     named file for reading and/or writing, as specified by the
  692.     flags argument, and returns a descriptor for that file.
  693.     The flags argument may indicate the file is to be created if
  694.     it does not already exist (by specifying the O_CREAT flag).
  695.     In this case an extra integer parameter pmode is used; the 
  696.     file is created with mode pmode as described in \#chmod\# and
  697.     modified by the process' umask value (see \#umask\#). 
  698.  
  699.     flags values are constructed by ORing flags from the following
  700.     list (one and only one of the first three flags below must
  701.     be used):
  702.       - O_RDONLY  Open for reading only.
  703.       - O_WRONLY  Open for writing only.
  704.       - O_RDWR    Open for reading and writing.
  705.  
  706.       - O_NDELAY  Non-blocking I/O.
  707.       - O_SYNC    Synchronize after writes (not implemented).
  708.       - O_APPEND  If set, the seek pointer will be set to
  709.                   the end of the file prior to each write.
  710.       - O_CREAT   Create the file if it doesn't exist already.
  711.       - O_TRUNC   If the file exists and is a regular file,
  712.                   and the file is successfully opened using
  713.                   O_RDWR or O_WRONLY, its length is truncated
  714.                   to zero.
  715.       - O_EXCL    If O_EXCL and O_CREAT are set, open will
  716.                   fail if the file exists. 
  717.  
  718.     The seek pointer used to mark the  current position within
  719.     the file is set to the beginning of the file.
  720.  
  721.     The new descriptor is set to remain open across \#execve\#
  722.     system calls; see \#close\# and \#fcntl\#.
  723.  
  724. RETURN VALUES
  725.     open returns a non-negative file descriptor on success.
  726.     On failure, it returns -1 and sets errno to indicate the
  727.     error.
  728.  
  729. SEE ALSO
  730.     \#chmod\#, \#close\#, \#creat\#, \#dup\#, \#fcntl\#, \#lseek\#, \#read\#, \#umask\#, \#write\#\end
  731.  
  732. screen( capsensitive("pathconf"))
  733. NAME
  734.     pathconf - query file system related limits and options
  735.  
  736. SYNOPSIS
  737.     #include <unistd.h>
  738.  
  739.     long pathconf(const char *path, int name);
  740.  
  741. DESCRIPTION
  742.     pathconf provides a method for the application to determine
  743.     the current value of a configurable limit or option that is
  744.     associated with the file-system containing the file or
  745.     directory named in path.
  746.  
  747.     The following parameters to pathconf are supported:
  748.  
  749.     Name          Meaning                           Note
  750.     _PC_LAST      max limit # for pathconf          NOT POSIX
  751.     _PC_IOPEN_MAX internal limit on open files      NOT POSIX
  752.     _PC_LINK_MAX  max # of links                    POSIX
  753.     _PC_PATH_MAX  max len of a full pathname        POSIX
  754.     _PC_NAME_MAX  max len of individual name        POSIX
  755.     _PC_PIPE_BUF  bytes written atomically to fifo  POSIX
  756.     _PC_NO_TRUNC  filename truncation               POSIX
  757.  
  758. RETURN VALUES
  759.     pathconf returns the current variable value on success.
  760.     On failure, it returns -1 and sets errno to indicate the error.
  761.  
  762. SEE ALSO
  763.     \#sysconf\#
  764.     \#Dpathconf\#; this system call is used in the implementation of
  765.     this routine.
  766.  
  767. NOTE
  768.     It's a pity this routine does not conform to POSIX; but then,
  769.     it's even more a pity that MiNT does not comply...\end
  770.  
  771. screen( capsensitive("pause"))
  772. NAME
  773.     pause - suspend process until signal
  774.  
  775. SYNOPSIS
  776.     ?? No header file yet. #include <signal.h>?
  777.  
  778.     void pause(void);
  779.  
  780. DESCRIPTION
  781.     pause suspends the calling process until it receives a
  782.     signal. The signal must be one that is not currently set
  783.     to be ignored by the calling process.
  784.  
  785.     If the signal causes termination of the calling process,
  786.     pause will not return.
  787.  
  788. SEE ALSO
  789.     \#alarm\#, \#kill\#, \#signal\#, \#sigpause\#, \#wait\#
  790.     \#Pause\#; this system call is used in the implementation
  791.     of this routine.
  792.  
  793. NOTE
  794.     For vague reasons, pause returns an integer on System V.\end
  795.  
  796. screen( capsensitive("pipe"))
  797. NAME
  798.     pipe - create an interprocess communication channel
  799.  
  800. SYNOPSIS
  801.     #include <unistd.h>
  802.  
  803.     int pipe(int fd[2]);
  804.  
  805. DESCRIPTION
  806.     This function only works when MiNT is active.
  807.  
  808.     The pipe system call creates an I/O mechanism called a
  809.     pipe and returns two file descriptors, fd[0] and fd[1].
  810.     fd[0] is opened for reading and fd[1] is opened for writing.
  811.     When the pipe is written using the descriptor fd[1] up to 4096
  812.     bytes of data are buffered before the writing process is blocked.
  813.     A read only file descriptor fd[0] accesses the data written to
  814.     fd[1] on a FIFO (first-in-first-out) basis.
  815.  
  816.     The standard programming model is that after the pipe has
  817.     been set up, two (or more) cooperating processes (created by
  818.     subsequent \#fork\# calls) will pass data through the pipe
  819.     using \#read\# and \#write\#.
  820.  
  821.     Read calls on an empty pipe (no buffered data) with only one
  822.     end (all write file descriptors closed) returns an EOF (end
  823.     of file).
  824.  
  825.     A SIGPIPE signal is generated if a write on a pipe with only
  826.     one end is attempted.
  827.  
  828. RETURN VALUES
  829.     pipe returns:
  830.  
  831.      0 on success.
  832.     -1 on failure and sets errno to indicate the error.
  833.  
  834. NOTES
  835.     in MiNT, pipes are really the same as FIFOs.
  836.  
  837. SEE ALSO
  838.     \#fork\#, \#read\#, \#write\#, \#signal\#
  839.     \#Fpipe\# - this system call has been used in the
  840.     implementation of this routine.\end
  841.  
  842. screen( capsensitive("read"))
  843. NAME
  844.     read - read input
  845.  
  846. SYNOPSIS
  847.     #include <unistd.h>
  848.  
  849.     int read(int fd, void *buffer, unsigned int length);
  850.  
  851. DESCRIPTION
  852.     read attempts to read length bytes of data from the file
  853.     referenced by the descriptor fd into the buffer pointed to
  854.     by buffer. 
  855.  
  856.     On objects capable of seeking, the read starts at a position
  857.     given by the pointer associated with fd (see \#lseek\#). Upon return
  858.     from read, the pointer is incremented by the number of bytes
  859.     actually read.
  860.  
  861.     Objects that are not capable of seeking always read from the
  862.     current position. The value of the pointer associated with
  863.     such an object is undefined.
  864.  
  865.     Upon successful completion, read returns the number of bytes
  866.     actually read and placed in the buffer. The system guarantees to
  867.     read the number of bytes requested if the descriptor references a
  868.     normal file which has that many bytes left before the EOF (end of
  869.     file), but in no other case.
  870.  
  871.     If nbytes is not zero and read returns 0, then EOF has been
  872.     reached.
  873.  
  874.     If the descriptor or the object is marked for non-blocking I/O,
  875.     and less data are available than are requested by the read,
  876.     only the data that are available are returned, and the count
  877.     indicates how many bytes of data were actually read.
  878.  
  879. RETURN VALUES
  880.     read returns the number of bytes actually read on success.
  881.     On failure, it returns -1 and sets errno to indicate the error.
  882.  
  883. SEE ALSO
  884.     \#dup\#, \#fcntl\#, \#ioctl\#, \#lseek\#, \#open\#, \#pipe\#\end
  885.  
  886. screen( capsensitive("readlink"))
  887. NAME
  888.     readlink - read value of a symbolic link
  889.  
  890. SYNOPSIS
  891.     #include <support.h>
  892.  
  893.  ?? int readlink(const char *path, char *buf, int bufsiz); // Should be like this
  894.     int readlink(char *path, char *buf, int bufsiz);
  895.  
  896. DESCRIPTION
  897.     readlink places the contents of the symbolic link referred to by
  898.     path in the buffer buf which has size bufsiz. The buffer must be
  899.     large enough to hold the string and the terminating null.
  900.  
  901. RETURN VALUES
  902.     readlink returns the number of characters placed in the buffer,
  903.     minus the terminating zero. On failure, it returns -1 and sets
  904.     errno to indicate the error.
  905.  
  906. SEE ALSO
  907.     \#lstat\#, \#symlink\#
  908.     \#Freadlink\#; this system call is used in the implementation
  909.     of this routine.
  910.  
  911. NOTES
  912.     On UN*X, the contents of the buffer is not null-terminated;
  913.     the size of the buffer as passed to the readlink call is
  914.     therefore off by one when compared to the mintlibs. It is
  915.     unlikely that this would ever be a problem.
  916.  
  917.     MS-DOS (TOS) file-systems do not support symbolic links.\end
  918.  
  919. screen( capsensitive("rmdir"))
  920. NAME
  921.     rmdir - remove a directory
  922.  
  923. SYNOPSIS
  924.     #include <unistd.h>
  925.  
  926.     int rmdir(const char *path);
  927.  
  928. DESCRIPTION
  929.     rmdir removes the directory named by the path parameter. The directory
  930.     must not have any entries other than "." and "..".
  931.  
  932. RETURN VALUES
  933.      0 on success
  934.     -1 on failure; errno is set to indicate the error.
  935.  
  936. SEE ALSO
  937.     \#mkdir\#
  938.     \#Ddelete\#; this system call is used in the implementation of this
  939.     routine.\end
  940.  
  941. screen( capsensitive("setuid"),
  942.         capsensitive("setgid"),
  943.         capsensitive("seteuid"),
  944.         capsensitive("setegid"),
  945.         capsensitive("setreuid"),
  946.         capsensitive("setregid"))
  947. NAME
  948.     setuid, setgid - set user and group IDs
  949.  
  950. SYNOPSIS
  951.     #include <unistd.h>
  952.  
  953.     int setuid(int uid);
  954.     int setgid(int gid);
  955.  
  956. DESCRIPTION
  957.     setuid (setgid) is used to set the real user (group) ID and effective
  958.     user (group) ID of the calling process.
  959.  
  960.     If the effective user ID of the calling process is super-user, the
  961.     real user (group) ID and effective user (group) ID are set to uid (gid).
  962.  
  963.     If the effective user ID of the calling process is not super-user,
  964.     but its real user (group) ID is equal to uid (gid), the effective
  965.     user (group) ID is set to uid (gid).
  966.  
  967.     setuid (setgid) will fail if the real user (group) ID of the calling
  968.     process is not equal to uid (gid) and its effective user ID is not
  969.     super-user.
  970.  
  971. RETURN VALUES
  972.      0 on success
  973.     -1 on failure; errno is set to indicate the error.
  974.  
  975. SEE ALSO
  976.     \#getuid\#, \#getgid\#, \#geteuid\#, \#getegid\#
  977.     \#Psetuid\#, \#Psetgid\#; these system calls are used
  978.     in the implementation of these routines.
  979.  
  980. NOTES
  981.     The related functions seteuid, setegid, setreuid and setregid
  982.     are also available in the MiNTlibs but really are the same.
  983.  
  984. BUGS
  985.     When MiNT is not active, these calls are pretty bogus.
  986.  
  987.     Security in MiNT is a joke; don't rely on these calls to actually
  988.     protect you from anything, it's more for informational purposes.\end
  989.  
  990. screen( capsensitive("signal"))
  991. NAME
  992.     signal - software signal facilities
  993.  
  994. SYNOPSIS
  995.     #include <signal.h>
  996.  
  997.     __Sigfunc signal(int sig, __Sigfunc func);
  998.  
  999.     __Sigfunc is defined in <signal.h> in the following way:
  1000.       typedef void (*__Sigfunc) (int signum);
  1001.  
  1002. DESCRIPTION
  1003.     Signals are only handled properly when MiNT is active.
  1004.     You are advised to read the entries for \#Psignal\#, \#Psigaction\#,
  1005.     \#Psigpause\# and \#Psigblock\# for the mechanism used.
  1006.     When MiNT is not active, signals are emulated under TOS. This
  1007.     fails to handle all types of signals properly.
  1008.  
  1009.     Signals for MiNT are explained in the document signal.doc,
  1010.     which comes with the MiNT distribution.
  1011.  
  1012.     A signal is generated by some abnormal event, initiated by a
  1013.     user at a terminal (quit, interrupt, stop), by a program error
  1014.     (bus error, etc.), by request of another program (kill), or
  1015.     when a process is stopped because it wishes to access its
  1016.     control terminal while in the background. Signals are optionally
  1017.     generated when a process resumes after being stopped, when the
  1018.     status of child processes changes, or when input is ready at the
  1019.     control terminal. Most signals cause termination of the receiving
  1020.     process if no action is taken; some signals instead cause the
  1021.     process receiving them to be stopped, or are simply discarded if
  1022.     the process has not requested otherwise. Except for the SIGKILL
  1023.     and SIGSTOP signals, the signal call allows signals either to
  1024.     be ignored or to interrupt to a specified location.
  1025.     For a list of signals and their default actions, see the file
  1026.     signal.doc.
  1027.  
  1028.     If func is SIG_DFL, the default action for signal sig is
  1029.     reinstated. If func is SIG_IGN the signal is subsequently
  1030.     ignored and pending instances of the signal are discarded.
  1031.     Otherwise, when the signal occurs further occurrences of the
  1032.     signal are automatically blocked and func is called.
  1033.  
  1034.     A return from the function unblocks the handled signal and
  1035.     continues the process at the point it was interrupted.
  1036.  
  1037.     After a \#fork\# or \#vfork\# the child inherits all signals.
  1038.     An \#execve\# resets all caught signals to the default
  1039.     action; ignored signals remain ignored.
  1040.  
  1041. RETURN VALUES
  1042.     signal returns the previous action on success.  On
  1043.     failure, it returns -1 and sets errno to indicate the error.
  1044.  
  1045. SEE ALSO
  1046.     \#execve\#, \#fork\#, \#getrlimit\#, \#kill\#, \#sigblock\#, 
  1047.     \#sigsetmask\#, \#vfork\#
  1048.  
  1049. NOTE
  1050.     As the document signal.doc shows, signals under MiNT
  1051.     work in a rather different way than the UN*X version.
  1052.     Also, the names and types of signals supported are
  1053.     different from the UN*X version.\end
  1054.  
  1055. screen( capsensitive("stat"),
  1056.         capsensitive("lstat"),
  1057.         capsensitive("fstat"))
  1058. NAME
  1059.     stat, lstat, fstat - get file status
  1060.  
  1061. SYNOPSIS
  1062.     #include <sys/types.h>
  1063.     #include <sys/stat.h>
  1064.  
  1065.     int stat(const char *path, struct stat *buf);
  1066.  
  1067.     int lstat(const char *path, struct stat *buf);
  1068.  
  1069.     int fstat(int fd, struct stat *buf);
  1070.  
  1071. DESCRIPTION
  1072.     stat obtains information about the file named by path.
  1073.     Read, write or execute permission of the named file is not
  1074.     required, but all directories listed in the path name leading
  1075.     to the file must be searchable.
  1076.  
  1077.     lstat is like stat except in the cases where the named
  1078.     file is a symbolic link, in which case lstat returns
  1079.     information about the link, while stat returns information
  1080.     about the file the link references.
  1081.  
  1082.     fstat obtains the same information about an open file
  1083.     referenced by the the file descriptor, such as would be
  1084.     returned by an \#creat\#, \#open\#, \#dup\#, \#fcntl\# or \#pipe\# call.
  1085.  
  1086.     buf is a pointer to a stat structure into which information
  1087.     is placed concerning the file. The stat structure is defined
  1088.     in <sys/stat.h> and contains the following fields of interest:
  1089.       struct stat
  1090.       {
  1091.         u_short st_mode;    /* file mode                          */
  1092.         ino_t   st_ino;     /* the file serial number             */
  1093.         dev_t   st_dev;     /* device file resides on             */
  1094.         short   st_rdev;    /* the device identifier              */
  1095.         short   st_nlink;   /* number of hard links to the file   */
  1096.         uid_t   st_uid;     /* user ID of the owner               */
  1097.         gid_t   st_gid;     /* group ID of the owner              */
  1098.         off_t   st_size;    /* total size of the file, in bytes   */
  1099.         off_t   st_blksize; /* preferred blocksize for system I/O */
  1100.         off_t   st_blocks;  /* actual number of blocks allocated  */
  1101.         time_t  st_mtime;   /* file last modify time              */
  1102.         time_t  st_atime;   /* file last access time              */
  1103.         time_t  st_ctime;   /* file last status change time       */
  1104.         short   st_attr;    /* file attributes                    */
  1105.         ...                 /* various fields reserved for MiNT   */
  1106.       };
  1107.  
  1108.     The following masks are available in <sys/stat.h> to test the
  1109.     st_mode field in the stat structure:
  1110.       #define S_IFMT    0170000   /* type of file         */
  1111.       #define S_IFCHR   0020000   /* character special    */
  1112.       #define S_IFDIR   0040000   /* directory            */
  1113.       #define S_IFBLK   0060000   /* block special        */
  1114.       #define S_IFREG   0100000   /* regular file         */
  1115.       #define S_IFIFO   0120000   /* FIFO special         */
  1116.       #define S_IMEM    0140000   /* shared memory (?)    */
  1117.       #define S_IFLNK   0160000   /* symbolic link        */
  1118.       #define S_ISUID   04000     /* set-uid on execution */
  1119.       #define S_ISGID   02000     /* set-gid on execution */
  1120.       #define S_ISVTX   01000     /* save swapped text    */
  1121.  
  1122.     The following masks are available in <sys/stat.h> to test the
  1123.     st_attr field in the stat structure:
  1124.       #define S_IRUSR   0400      /* readable by user     */
  1125.       #define S_IWUSR   0200      /* writeable by user    */
  1126.       #define S_IXUSR   0100      /* executable by user   */
  1127.       #define S_IRGRP   0040      /* readable by group    */
  1128.       #define S_IWGRP   0020      /* writable by group    */
  1129.       #define S_IXGRP   0010      /* executable by group  */
  1130.       #define S_IROTH   0004      /* readable by others   */
  1131.       #define S_IWOTH   0002      /* writable by others   */
  1132.       #define S_IXOTH   0001      /* executable by others */
  1133.  
  1134. RETURN VALUES
  1135.      0  on success.
  1136.     -1  on failure; errno is set to indicate the error.
  1137.  
  1138. SEE ALSO
  1139.     \#chmod\#, \#chown\# for the use of file attributes.
  1140.  
  1141.     \#Fcntl\#, \#Fxattr\#: these systems calls are used in the
  1142.     implementation of the stat, lstat and fstat routines.
  1143.  
  1144. NOTE
  1145.     When MiNT is not active, these calls are emulated under TOS.
  1146.     The TOS implemenation of fstat in particular is pretty bogus.
  1147.     You are advised to read the source code of stat.c if you want
  1148.     to make use of other than the most basic attributes under
  1149.     TOS emulation.\end
  1150.  
  1151. screen( capsensitive("stime"))
  1152. NAME
  1153.     stime - set time
  1154.  
  1155. SYNOPSIS
  1156.     #include <unistd.h>
  1157.  
  1158.     int stime(long *tp);
  1159.  
  1160. DESCRIPTION
  1161.     stime sets the system's idea of the time and date. tp points
  1162.     to the value of time as measured in seconds from 00:00:00 GMT
  1163.     January 1, 1970.
  1164.  
  1165. SEE ALSO
  1166.     \#time\#
  1167.     \#Tsetdate\#, \#Tsettime\#; these system calls are used in the
  1168.     implementation of this routine.
  1169.  
  1170. RETURN VALUES
  1171.      0 on success.
  1172.     -1 on failure; errno is set to indicate the error.
  1173.  
  1174. NOTE
  1175.     On UN*X, only the super-user may call this function.
  1176.     Under the current version of MiNT and using the current version
  1177.     of the mintlibs, any user is allowed to change the system time.
  1178.     Don't rely on this behavior, as it will be changed in the future.\end
  1179.  
  1180. screen( capsensitive("symlink"))
  1181. NAME
  1182.     symlink - make symbolic link to a file
  1183.  
  1184. SYNOPSIS
  1185.     #include <support.h>
  1186.  
  1187.     int symlink(const char *old, const char *new);
  1188.  
  1189. DESCRIPTION
  1190.     A symbolic link new is created to old (new is the name of the
  1191.     file created, old is the string used in creating the symbolic
  1192.     link). Either name may be an arbitrary path name; the files
  1193.     need not be on the same file system.
  1194.  
  1195.     The file that the symbolic link points to is used when an
  1196.     \#open\# operation is performed on the link. A \#stat\# on a
  1197.     symbolic link returns the linked-to file, while an \#lstat\#
  1198.     returns information about the link itself. This can lead to
  1199.     suprising results when a symbolic link is made to a
  1200.     directory. To avoid confusion in programs, the \#readlink\# call
  1201.     can be used to read the contents of a symbolic link.
  1202.  
  1203. RETURN VALUES
  1204.     symlink returns:
  1205.  
  1206.      0 on success
  1207.     -1 on failure; errno is set to indicate the error
  1208.  
  1209. SEE ALSO
  1210.     \#link\#, \#readlink\#, \#unlink\#
  1211.     \#Fsymlink\#; this system call is used in the implementation
  1212.     of this routine.
  1213.  
  1214. NOTES
  1215.     MS-DOS (TOS) file-systems do not support symbolic links.
  1216.  
  1217.     The file or directory linked to (old) need not exist.\end
  1218.  
  1219. screen( capsensitive("tfork"))
  1220. NAME
  1221.     tfork - start a new thread
  1222.  
  1223. SYNOPSIS
  1224.     long tfork(int (*func)(long), long arg);
  1225.  
  1226. DESCRIPTION
  1227.     tfork starts a new thread of execution running in the same
  1228.     address space. The new thread gets its own 4K stack, and
  1229.     starts at the address in func with arg on the stack, i.e.
  1230.     as though the main program had a call like (*func)(arg).
  1231.     The main program continues executing, with tfork returning
  1232.     the process ID of the child.
  1233.  
  1234.     If MiNT is not active, then the child runs to completion
  1235.     and the return value is the child's exit status; \#vfork\#
  1236.     relies on this behavior.
  1237.  
  1238. SEE ALSO
  1239.     \link("exec")exec..\#, \#fork\#, \#vfork\#, \#wait\#
  1240.  
  1241. NOTES
  1242.     Parent and child share the same memory; this could cause
  1243.     problems with some library calls, notably \#malloc\#.\end
  1244.  
  1245. screen( capsensitive("time"))
  1246. NAME
  1247.     time - get time
  1248.  
  1249. SYNOPSIS
  1250.     #include <sys/types.h>
  1251.     #include <time.h>
  1252.  
  1253.     time_t time(time_t *tloc);
  1254.  
  1255. DESCRIPTION
  1256.     time returns the value of time in seconds since 00:00:00
  1257.     GMT, January 1, 1970.
  1258.  
  1259.     If tloc is non-zero, the return value is also stored in
  1260.     the location to which tloc points.
  1261.  
  1262. SEE ALSO
  1263.     \#stime\#
  1264.     \#Tgetdate\#, \#Tgettime\#; this system calls are used in the
  1265.     implementation of this routine.\end
  1266.  
  1267. screen( capsensitive("sysconf"))
  1268. NAME
  1269.     sysconf - query system related limits, values, options
  1270.  
  1271. SYNOPSIS
  1272.     #include <unistd.h>
  1273.  
  1274.     long sysconf(int name);
  1275.  
  1276. DESCRIPTION
  1277.     The sysconf function provides a method for the application to
  1278.     determine the current value of a configurable system limit or
  1279.     option. The value does not change during the lifetime of the
  1280.     calling process.
  1281.  
  1282.     The following parameters to sysconf are supported:
  1283.  
  1284.     Name            Meaning                         Note
  1285.     _SC_LAST        max limit # for sysconf         NOT POSIX
  1286.     _SC_MEMR_MAX    memory regions per process      NOT POSIX
  1287.     _SC_ARG_MAX     max length of cmdln             NOT quite POSIX
  1288.     _SC_OPEN_MAX    max # of open files per process POSIX
  1289.     _SC_NGROUPS_MAX max # supp gids                 POSIX
  1290.     _SC_CHILD_MAX   max # processes/user            NOT quite POSIX
  1291.  
  1292. RETURN VALUES
  1293.     sysconf returns the current variable value on success.
  1294.     On failure, it returns -1 and sets errno to indicate the error.
  1295.  
  1296. SEE ALSO
  1297.     \#pathconf\#
  1298.     \#Sysconf\#; this system call is used in the implementation of
  1299.     this routine.
  1300.  
  1301. NOTE
  1302.     It's a pity this routine does not conform to POSIX; but then,
  1303.     it's even more a pity that MiNT does not comply...\end
  1304.  
  1305. screen( capsensitive("umask"))
  1306. NAME
  1307.     umask - set file creation mode mask
  1308.  
  1309. SYNOPSIS
  1310.     #include <unistd.h>
  1311.     #include <sys/stat.h>
  1312.  
  1313.     int umask(int mask);
  1314.  
  1315. DESCRIPTION
  1316.     umask sets the process's file creation mask to mask and returns
  1317.     the previous value of the mask. The low-order 9 bits of mask are 
  1318.     used whenever a file is created, clearing corresponding bits in
  1319.     the file access permissions (see \#stat\#). This clearing restricts
  1320.     the default access to a file.
  1321.  
  1322.     The mask is inherited by child processes.
  1323.  
  1324. RETURN VALUES
  1325.     umask returns the previous value of the file creation mask.
  1326.  
  1327. SEE ALSO
  1328.     \#chmod\#, \#open\#
  1329.  
  1330.     \#Pumask\# - this system call is used in the implementation
  1331.     of this routine.\end
  1332.  
  1333. screen( capsensitive("unlink"),
  1334.         capsensitive("remove"))
  1335. NAME
  1336.     unlink - remove directory entry
  1337.  
  1338. SYNOPSIS
  1339.     #include <unistd.h>
  1340.  
  1341.     int unlink(char *path);
  1342.  
  1343.     #include <stdio.h>
  1344.  
  1345.     int remove(const char *path);
  1346.  
  1347. DESCRIPTION
  1348.     unlink removes the directory entry named by the pathname
  1349.     pointed to by path.
  1350.     On file systems that allow hard links, the link count of the file
  1351.     referred to by that entry is decremented by one. If this entry was
  1352.     the last link to the file, the file is removed.
  1353.  
  1354.     If any process has the file open, and the file system supports
  1355.     removal of open files, the actual resource reclamation is delayed
  1356.     until the file is closed, even though the directory entry has
  1357.     disappeared.
  1358.  
  1359. RETURN VALUES
  1360.     unlink returns:
  1361.  
  1362.      0 on success.
  1363.     -1 on failure and sets errno to indicate the error.
  1364.  
  1365. SEE ALSO
  1366.     \#close\#, \#link\#, \#rmdir\#
  1367.  
  1368. NOTES
  1369.     Applications should use \#rmdir\# to remove directories.
  1370.  
  1371.     MS-DOS (TOS) filesystems do not support hardlinks.
  1372.  
  1373.     MS-DOS (TOS) filesystems only allow the removal of open
  1374.     files, to be deleted on closing, since MiNT 0.98. The
  1375.     file will still have a directory entry, though.
  1376.  
  1377.     The identical function remove is available for backwards
  1378.     compatibility. Its use is discouraged.\end
  1379.  
  1380. screen( capsensitive("vfork"))
  1381. NAME
  1382.     vfork - spawn new process in a memory efficient way
  1383.  
  1384. SYNOPSIS
  1385.     #include <unistd.h>
  1386.  
  1387.     int vfork(void);
  1388.  
  1389. DESCRIPTION
  1390.     vfork can be used to create new processes without fully
  1391.     copying the address space of the parent process, which
  1392.     is unnecessary in many cases. It is useful when the only
  1393.     purpose of \#fork\# would have been to create a new process
  1394.     just in order to do an \link("exec")exec..\# call. vfork differs from
  1395.     \#fork\# in that the child borrows the parent's memory and
  1396.     thread of control until a call to \link("exec")exec..\#, or an exit
  1397.     (either by a call to \#_exit\# or abnormally). The parent
  1398.     process is suspended while the child is using its resources.
  1399.  
  1400.     vfork returns zero to the child and (later) the process ID
  1401.     of the child to the parent.
  1402.  
  1403. SEE ALSO
  1404.     \link("exec")exec..\#, \#fork\#, \#tfork\#, \#wait\#
  1405.  
  1406. NOTES
  1407.     The child should never return from the procedure that called
  1408.     vfork, since that will mess up the stack frame for the parent
  1409.     on its return from vfork.
  1410.  
  1411.     The vfork call is not available in UN*X System V.3.
  1412.     It will disappear from SunOS in the future (in fact, it would
  1413.     have disappeared if it weren't for the program mentioned below).
  1414.     So, if you want to write portable code, \#fork\#, don't vfork.
  1415.  
  1416.     Changes the child makes to the parents' variables will have
  1417.     effect on the parent. Do not rely on this, since it is a
  1418.     disgusting habit. (Presumably, this is why the Berkeley C-Shell
  1419.     has been implemented this way.)\end
  1420.  
  1421. screen( capsensitive("write"))
  1422. NAME
  1423.     write - write on a file
  1424.  
  1425. SYNOPSIS
  1426.     #include <unistd.h>
  1427.  
  1428.     int write(int fildes, const void *buf, unsigned nbyte);
  1429.  
  1430. DESCRIPTION
  1431.     fildes is a file descriptor obtained from a \#creat\#, \#open\#, \#dup\#,
  1432.     \#fcntl\#, or \#pipe\# system call.
  1433.  
  1434.     write attempts to write nbyte bytes from the buffer pointed to by
  1435.     buf to the file associated with fildes.
  1436.  
  1437.     When fildes indicates a device, writing always takes place at the
  1438.     current position. When fildes indicates a file, the actual writing
  1439.     of data proceeds from the position in the file indicated by the
  1440.     file pointer. Upon return from write, the file pointer is
  1441.     incremented by the number of bytes actually written.
  1442.     If the O_APPEND flag of the file status flags is set, the file
  1443.     pointer will be set to the end of the file prior to writing.
  1444.     
  1445. RETURN VALUES
  1446.     Upon successful completion the number of bytes actually written
  1447.     is returned. Otherwise, -1 is returned and errno is set to indicate
  1448.     the error.
  1449.  
  1450. NOTE
  1451.     The underlying call, \#Fwrite\#, takes a long nbyte parameter and
  1452.     returns a long result. This means that, when 16-bit integers are
  1453.     used, \#Fwrite\# can write over 64 Kb at a time while write cannot.
  1454.  
  1455. SEE ALSO
  1456.     \#creat\#, \#dup\#, \#fcntl\#, \#lseek\#, \#open\#, \#pipe\#
  1457.     \#Fwrite\#; this system call is used in the implementation of
  1458.     this routine.\end
  1459.  
  1460.